<template>
	<div class="image-wrap">
		<div class="image-height-scale" :style="{paddingBottom:heightScale}"></div>
		<div class="image-content">
			<slot>
				<img :src="imgUrl" @error="errorHandle"></img>
			</slot>
		</div>
	</div>
</template>

<script>
export default {
  props: {
    heightScale: {
      type: String,
      default: ''
    },
    imgUrl: {
      type: String,
      default: ''
    }
  },
  methods: {
    errorHandle(e) {
      console.log(e)
    }
  }
}
</script>

<style scoped lang="less">
.image-wrap {
  position: relative;

  .image-height-scale {
    padding-bottom: 56.122%;
  }

  .image-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    img {
      width: 100%;
      height: 100%;
      pointer-events: none;
    }
  }
}
</style>
